package org.goochasca

private[goochasca] trait Labels extends Chart {
  
  private var labels: Seq[Any] = Seq.empty
  
  def setLabels(labels: Any*) {
    this.labels = labels
  }
  
  protected abstract override def appendParms(sb: StringBuilder) {
    super.appendParms(sb)
    var first = true
    for (label <- labels) {
      if (first) {
        sb append "&chl="
        first = false
      } else {
        sb append '|'
      }
      sb append Chart.escape(label.toString)
    }
  }
}
